Left Termination of the query pattern query_in_1(g) w.r.t. the given Prolog program could not be shown:



Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof

Clauses:

append(nil, XS, XS).
append(cons(X, XS), YS, cons(X, ZS)) :- append(XS, YS, ZS).
reverse(nil, nil).
reverse(cons(X, nil), cons(X, nil)).
reverse(cons(X, XS), YS) :- ','(reverse(XS, ZS), append(ZS, cons(X, nil), YS)).
shuffle(nil, nil).
shuffle(cons(X, XS), cons(X, YS)) :- ','(reverse(XS, ZS), shuffle(ZS, YS)).
query(XS) :- shuffle(cons(X, XS), YS).

Queries:

query(g).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
query_in: (b)
shuffle_in: (f,f)
reverse_in: (f,f)
append_in: (f,f,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

query_in_g(XS) → U6_g(XS, shuffle_in_aa(cons(X, XS), YS))
shuffle_in_aa(nil, nil) → shuffle_out_aa(nil, nil)
shuffle_in_aa(cons(X, XS), cons(X, YS)) → U4_aa(X, XS, YS, reverse_in_aa(XS, ZS))
reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
U4_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_aa(X, XS, YS, shuffle_in_aa(ZS, YS))
U5_aa(X, XS, YS, shuffle_out_aa(ZS, YS)) → shuffle_out_aa(cons(X, XS), cons(X, YS))
U6_g(XS, shuffle_out_aa(cons(X, XS), YS)) → query_out_g(XS)

The argument filtering Pi contains the following mapping:
query_in_g(x1)  =  query_in_g(x1)
U6_g(x1, x2)  =  U6_g(x2)
shuffle_in_aa(x1, x2)  =  shuffle_in_aa
shuffle_out_aa(x1, x2)  =  shuffle_out_aa
U4_aa(x1, x2, x3, x4)  =  U4_aa(x4)
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x4)
query_out_g(x1)  =  query_out_g

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof
  ↳ PrologToPiTRSProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

query_in_g(XS) → U6_g(XS, shuffle_in_aa(cons(X, XS), YS))
shuffle_in_aa(nil, nil) → shuffle_out_aa(nil, nil)
shuffle_in_aa(cons(X, XS), cons(X, YS)) → U4_aa(X, XS, YS, reverse_in_aa(XS, ZS))
reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
U4_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_aa(X, XS, YS, shuffle_in_aa(ZS, YS))
U5_aa(X, XS, YS, shuffle_out_aa(ZS, YS)) → shuffle_out_aa(cons(X, XS), cons(X, YS))
U6_g(XS, shuffle_out_aa(cons(X, XS), YS)) → query_out_g(XS)

The argument filtering Pi contains the following mapping:
query_in_g(x1)  =  query_in_g(x1)
U6_g(x1, x2)  =  U6_g(x2)
shuffle_in_aa(x1, x2)  =  shuffle_in_aa
shuffle_out_aa(x1, x2)  =  shuffle_out_aa
U4_aa(x1, x2, x3, x4)  =  U4_aa(x4)
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x4)
query_out_g(x1)  =  query_out_g


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

QUERY_IN_G(XS) → U6_G(XS, shuffle_in_aa(cons(X, XS), YS))
QUERY_IN_G(XS) → SHUFFLE_IN_AA(cons(X, XS), YS)
SHUFFLE_IN_AA(cons(X, XS), cons(X, YS)) → U4_AA(X, XS, YS, reverse_in_aa(XS, ZS))
SHUFFLE_IN_AA(cons(X, XS), cons(X, YS)) → REVERSE_IN_AA(XS, ZS)
REVERSE_IN_AA(cons(X, XS), YS) → U2_AA(X, XS, YS, reverse_in_aa(XS, ZS))
REVERSE_IN_AA(cons(X, XS), YS) → REVERSE_IN_AA(XS, ZS)
U2_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_AA(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
U2_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → APPEND_IN_AAA(ZS, cons(X, nil), YS)
APPEND_IN_AAA(cons(X, XS), YS, cons(X, ZS)) → U1_AAA(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
APPEND_IN_AAA(cons(X, XS), YS, cons(X, ZS)) → APPEND_IN_AAA(XS, YS, ZS)
U4_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_AA(X, XS, YS, shuffle_in_aa(ZS, YS))
U4_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → SHUFFLE_IN_AA(ZS, YS)

The TRS R consists of the following rules:

query_in_g(XS) → U6_g(XS, shuffle_in_aa(cons(X, XS), YS))
shuffle_in_aa(nil, nil) → shuffle_out_aa(nil, nil)
shuffle_in_aa(cons(X, XS), cons(X, YS)) → U4_aa(X, XS, YS, reverse_in_aa(XS, ZS))
reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
U4_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_aa(X, XS, YS, shuffle_in_aa(ZS, YS))
U5_aa(X, XS, YS, shuffle_out_aa(ZS, YS)) → shuffle_out_aa(cons(X, XS), cons(X, YS))
U6_g(XS, shuffle_out_aa(cons(X, XS), YS)) → query_out_g(XS)

The argument filtering Pi contains the following mapping:
query_in_g(x1)  =  query_in_g(x1)
U6_g(x1, x2)  =  U6_g(x2)
shuffle_in_aa(x1, x2)  =  shuffle_in_aa
shuffle_out_aa(x1, x2)  =  shuffle_out_aa
U4_aa(x1, x2, x3, x4)  =  U4_aa(x4)
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x4)
query_out_g(x1)  =  query_out_g
U5_AA(x1, x2, x3, x4)  =  U5_AA(x4)
U6_G(x1, x2)  =  U6_G(x2)
U2_AA(x1, x2, x3, x4)  =  U2_AA(x4)
QUERY_IN_G(x1)  =  QUERY_IN_G(x1)
REVERSE_IN_AA(x1, x2)  =  REVERSE_IN_AA
U1_AAA(x1, x2, x3, x4, x5)  =  U1_AAA(x5)
APPEND_IN_AAA(x1, x2, x3)  =  APPEND_IN_AAA
SHUFFLE_IN_AA(x1, x2)  =  SHUFFLE_IN_AA
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)
U4_AA(x1, x2, x3, x4)  =  U4_AA(x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

QUERY_IN_G(XS) → U6_G(XS, shuffle_in_aa(cons(X, XS), YS))
QUERY_IN_G(XS) → SHUFFLE_IN_AA(cons(X, XS), YS)
SHUFFLE_IN_AA(cons(X, XS), cons(X, YS)) → U4_AA(X, XS, YS, reverse_in_aa(XS, ZS))
SHUFFLE_IN_AA(cons(X, XS), cons(X, YS)) → REVERSE_IN_AA(XS, ZS)
REVERSE_IN_AA(cons(X, XS), YS) → U2_AA(X, XS, YS, reverse_in_aa(XS, ZS))
REVERSE_IN_AA(cons(X, XS), YS) → REVERSE_IN_AA(XS, ZS)
U2_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_AA(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
U2_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → APPEND_IN_AAA(ZS, cons(X, nil), YS)
APPEND_IN_AAA(cons(X, XS), YS, cons(X, ZS)) → U1_AAA(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
APPEND_IN_AAA(cons(X, XS), YS, cons(X, ZS)) → APPEND_IN_AAA(XS, YS, ZS)
U4_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_AA(X, XS, YS, shuffle_in_aa(ZS, YS))
U4_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → SHUFFLE_IN_AA(ZS, YS)

The TRS R consists of the following rules:

query_in_g(XS) → U6_g(XS, shuffle_in_aa(cons(X, XS), YS))
shuffle_in_aa(nil, nil) → shuffle_out_aa(nil, nil)
shuffle_in_aa(cons(X, XS), cons(X, YS)) → U4_aa(X, XS, YS, reverse_in_aa(XS, ZS))
reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
U4_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_aa(X, XS, YS, shuffle_in_aa(ZS, YS))
U5_aa(X, XS, YS, shuffle_out_aa(ZS, YS)) → shuffle_out_aa(cons(X, XS), cons(X, YS))
U6_g(XS, shuffle_out_aa(cons(X, XS), YS)) → query_out_g(XS)

The argument filtering Pi contains the following mapping:
query_in_g(x1)  =  query_in_g(x1)
U6_g(x1, x2)  =  U6_g(x2)
shuffle_in_aa(x1, x2)  =  shuffle_in_aa
shuffle_out_aa(x1, x2)  =  shuffle_out_aa
U4_aa(x1, x2, x3, x4)  =  U4_aa(x4)
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x4)
query_out_g(x1)  =  query_out_g
U5_AA(x1, x2, x3, x4)  =  U5_AA(x4)
U6_G(x1, x2)  =  U6_G(x2)
U2_AA(x1, x2, x3, x4)  =  U2_AA(x4)
QUERY_IN_G(x1)  =  QUERY_IN_G(x1)
REVERSE_IN_AA(x1, x2)  =  REVERSE_IN_AA
U1_AAA(x1, x2, x3, x4, x5)  =  U1_AAA(x5)
APPEND_IN_AAA(x1, x2, x3)  =  APPEND_IN_AAA
SHUFFLE_IN_AA(x1, x2)  =  SHUFFLE_IN_AA
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)
U4_AA(x1, x2, x3, x4)  =  U4_AA(x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 8 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN_AAA(cons(X, XS), YS, cons(X, ZS)) → APPEND_IN_AAA(XS, YS, ZS)

The TRS R consists of the following rules:

query_in_g(XS) → U6_g(XS, shuffle_in_aa(cons(X, XS), YS))
shuffle_in_aa(nil, nil) → shuffle_out_aa(nil, nil)
shuffle_in_aa(cons(X, XS), cons(X, YS)) → U4_aa(X, XS, YS, reverse_in_aa(XS, ZS))
reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
U4_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_aa(X, XS, YS, shuffle_in_aa(ZS, YS))
U5_aa(X, XS, YS, shuffle_out_aa(ZS, YS)) → shuffle_out_aa(cons(X, XS), cons(X, YS))
U6_g(XS, shuffle_out_aa(cons(X, XS), YS)) → query_out_g(XS)

The argument filtering Pi contains the following mapping:
query_in_g(x1)  =  query_in_g(x1)
U6_g(x1, x2)  =  U6_g(x2)
shuffle_in_aa(x1, x2)  =  shuffle_in_aa
shuffle_out_aa(x1, x2)  =  shuffle_out_aa
U4_aa(x1, x2, x3, x4)  =  U4_aa(x4)
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x4)
query_out_g(x1)  =  query_out_g
APPEND_IN_AAA(x1, x2, x3)  =  APPEND_IN_AAA

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN_AAA(cons(X, XS), YS, cons(X, ZS)) → APPEND_IN_AAA(XS, YS, ZS)

R is empty.
The argument filtering Pi contains the following mapping:
APPEND_IN_AAA(x1, x2, x3)  =  APPEND_IN_AAA

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

APPEND_IN_AAAAPPEND_IN_AAA

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

APPEND_IN_AAAAPPEND_IN_AAA

The TRS R consists of the following rules:none


s = APPEND_IN_AAA evaluates to t =APPEND_IN_AAA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from APPEND_IN_AAA to APPEND_IN_AAA.





↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

REVERSE_IN_AA(cons(X, XS), YS) → REVERSE_IN_AA(XS, ZS)

The TRS R consists of the following rules:

query_in_g(XS) → U6_g(XS, shuffle_in_aa(cons(X, XS), YS))
shuffle_in_aa(nil, nil) → shuffle_out_aa(nil, nil)
shuffle_in_aa(cons(X, XS), cons(X, YS)) → U4_aa(X, XS, YS, reverse_in_aa(XS, ZS))
reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
U4_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_aa(X, XS, YS, shuffle_in_aa(ZS, YS))
U5_aa(X, XS, YS, shuffle_out_aa(ZS, YS)) → shuffle_out_aa(cons(X, XS), cons(X, YS))
U6_g(XS, shuffle_out_aa(cons(X, XS), YS)) → query_out_g(XS)

The argument filtering Pi contains the following mapping:
query_in_g(x1)  =  query_in_g(x1)
U6_g(x1, x2)  =  U6_g(x2)
shuffle_in_aa(x1, x2)  =  shuffle_in_aa
shuffle_out_aa(x1, x2)  =  shuffle_out_aa
U4_aa(x1, x2, x3, x4)  =  U4_aa(x4)
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x4)
query_out_g(x1)  =  query_out_g
REVERSE_IN_AA(x1, x2)  =  REVERSE_IN_AA

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

REVERSE_IN_AA(cons(X, XS), YS) → REVERSE_IN_AA(XS, ZS)

R is empty.
The argument filtering Pi contains the following mapping:
REVERSE_IN_AA(x1, x2)  =  REVERSE_IN_AA

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

REVERSE_IN_AAREVERSE_IN_AA

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

REVERSE_IN_AAREVERSE_IN_AA

The TRS R consists of the following rules:none


s = REVERSE_IN_AA evaluates to t =REVERSE_IN_AA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from REVERSE_IN_AA to REVERSE_IN_AA.





↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U4_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → SHUFFLE_IN_AA(ZS, YS)
SHUFFLE_IN_AA(cons(X, XS), cons(X, YS)) → U4_AA(X, XS, YS, reverse_in_aa(XS, ZS))

The TRS R consists of the following rules:

query_in_g(XS) → U6_g(XS, shuffle_in_aa(cons(X, XS), YS))
shuffle_in_aa(nil, nil) → shuffle_out_aa(nil, nil)
shuffle_in_aa(cons(X, XS), cons(X, YS)) → U4_aa(X, XS, YS, reverse_in_aa(XS, ZS))
reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
U4_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_aa(X, XS, YS, shuffle_in_aa(ZS, YS))
U5_aa(X, XS, YS, shuffle_out_aa(ZS, YS)) → shuffle_out_aa(cons(X, XS), cons(X, YS))
U6_g(XS, shuffle_out_aa(cons(X, XS), YS)) → query_out_g(XS)

The argument filtering Pi contains the following mapping:
query_in_g(x1)  =  query_in_g(x1)
U6_g(x1, x2)  =  U6_g(x2)
shuffle_in_aa(x1, x2)  =  shuffle_in_aa
shuffle_out_aa(x1, x2)  =  shuffle_out_aa
U4_aa(x1, x2, x3, x4)  =  U4_aa(x4)
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x4)
query_out_g(x1)  =  query_out_g
SHUFFLE_IN_AA(x1, x2)  =  SHUFFLE_IN_AA
U4_AA(x1, x2, x3, x4)  =  U4_AA(x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U4_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → SHUFFLE_IN_AA(ZS, YS)
SHUFFLE_IN_AA(cons(X, XS), cons(X, YS)) → U4_AA(X, XS, YS, reverse_in_aa(XS, ZS))

The TRS R consists of the following rules:

reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))

The argument filtering Pi contains the following mapping:
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
SHUFFLE_IN_AA(x1, x2)  =  SHUFFLE_IN_AA
U4_AA(x1, x2, x3, x4)  =  U4_AA(x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Narrowing
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U4_AA(reverse_out_aa) → SHUFFLE_IN_AA
SHUFFLE_IN_AAU4_AA(reverse_in_aa)

The TRS R consists of the following rules:

reverse_in_aareverse_out_aa
reverse_in_aaU2_aa(reverse_in_aa)
U2_aa(reverse_out_aa) → U3_aa(append_in_aaa)
U3_aa(append_out_aaa) → reverse_out_aa
append_in_aaaappend_out_aaa
append_in_aaaU1_aaa(append_in_aaa)
U1_aaa(append_out_aaa) → append_out_aaa

The set Q consists of the following terms:

reverse_in_aa
U2_aa(x0)
U3_aa(x0)
append_in_aaa
U1_aaa(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule SHUFFLE_IN_AAU4_AA(reverse_in_aa) at position [0] we obtained the following new rules:

SHUFFLE_IN_AAU4_AA(U2_aa(reverse_in_aa))
SHUFFLE_IN_AAU4_AA(reverse_out_aa)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ NonTerminationProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U4_AA(reverse_out_aa) → SHUFFLE_IN_AA
SHUFFLE_IN_AAU4_AA(reverse_out_aa)
SHUFFLE_IN_AAU4_AA(U2_aa(reverse_in_aa))

The TRS R consists of the following rules:

reverse_in_aareverse_out_aa
reverse_in_aaU2_aa(reverse_in_aa)
U2_aa(reverse_out_aa) → U3_aa(append_in_aaa)
U3_aa(append_out_aaa) → reverse_out_aa
append_in_aaaappend_out_aaa
append_in_aaaU1_aaa(append_in_aaa)
U1_aaa(append_out_aaa) → append_out_aaa

The set Q consists of the following terms:

reverse_in_aa
U2_aa(x0)
U3_aa(x0)
append_in_aaa
U1_aaa(x0)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

U4_AA(reverse_out_aa) → SHUFFLE_IN_AA
SHUFFLE_IN_AAU4_AA(reverse_out_aa)
SHUFFLE_IN_AAU4_AA(U2_aa(reverse_in_aa))

The TRS R consists of the following rules:

reverse_in_aareverse_out_aa
reverse_in_aaU2_aa(reverse_in_aa)
U2_aa(reverse_out_aa) → U3_aa(append_in_aaa)
U3_aa(append_out_aaa) → reverse_out_aa
append_in_aaaappend_out_aaa
append_in_aaaU1_aaa(append_in_aaa)
U1_aaa(append_out_aaa) → append_out_aaa


s = SHUFFLE_IN_AA evaluates to t =SHUFFLE_IN_AA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

SHUFFLE_IN_AAU4_AA(reverse_out_aa)
with rule SHUFFLE_IN_AAU4_AA(reverse_out_aa) at position [] and matcher [ ]

U4_AA(reverse_out_aa)SHUFFLE_IN_AA
with rule U4_AA(reverse_out_aa) → SHUFFLE_IN_AA

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.




We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
query_in: (b)
shuffle_in: (f,f)
reverse_in: (f,f)
append_in: (f,f,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

query_in_g(XS) → U6_g(XS, shuffle_in_aa(cons(X, XS), YS))
shuffle_in_aa(nil, nil) → shuffle_out_aa(nil, nil)
shuffle_in_aa(cons(X, XS), cons(X, YS)) → U4_aa(X, XS, YS, reverse_in_aa(XS, ZS))
reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
U4_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_aa(X, XS, YS, shuffle_in_aa(ZS, YS))
U5_aa(X, XS, YS, shuffle_out_aa(ZS, YS)) → shuffle_out_aa(cons(X, XS), cons(X, YS))
U6_g(XS, shuffle_out_aa(cons(X, XS), YS)) → query_out_g(XS)

The argument filtering Pi contains the following mapping:
query_in_g(x1)  =  query_in_g(x1)
U6_g(x1, x2)  =  U6_g(x1, x2)
shuffle_in_aa(x1, x2)  =  shuffle_in_aa
shuffle_out_aa(x1, x2)  =  shuffle_out_aa
U4_aa(x1, x2, x3, x4)  =  U4_aa(x4)
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x4)
query_out_g(x1)  =  query_out_g(x1)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

query_in_g(XS) → U6_g(XS, shuffle_in_aa(cons(X, XS), YS))
shuffle_in_aa(nil, nil) → shuffle_out_aa(nil, nil)
shuffle_in_aa(cons(X, XS), cons(X, YS)) → U4_aa(X, XS, YS, reverse_in_aa(XS, ZS))
reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
U4_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_aa(X, XS, YS, shuffle_in_aa(ZS, YS))
U5_aa(X, XS, YS, shuffle_out_aa(ZS, YS)) → shuffle_out_aa(cons(X, XS), cons(X, YS))
U6_g(XS, shuffle_out_aa(cons(X, XS), YS)) → query_out_g(XS)

The argument filtering Pi contains the following mapping:
query_in_g(x1)  =  query_in_g(x1)
U6_g(x1, x2)  =  U6_g(x1, x2)
shuffle_in_aa(x1, x2)  =  shuffle_in_aa
shuffle_out_aa(x1, x2)  =  shuffle_out_aa
U4_aa(x1, x2, x3, x4)  =  U4_aa(x4)
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x4)
query_out_g(x1)  =  query_out_g(x1)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

QUERY_IN_G(XS) → U6_G(XS, shuffle_in_aa(cons(X, XS), YS))
QUERY_IN_G(XS) → SHUFFLE_IN_AA(cons(X, XS), YS)
SHUFFLE_IN_AA(cons(X, XS), cons(X, YS)) → U4_AA(X, XS, YS, reverse_in_aa(XS, ZS))
SHUFFLE_IN_AA(cons(X, XS), cons(X, YS)) → REVERSE_IN_AA(XS, ZS)
REVERSE_IN_AA(cons(X, XS), YS) → U2_AA(X, XS, YS, reverse_in_aa(XS, ZS))
REVERSE_IN_AA(cons(X, XS), YS) → REVERSE_IN_AA(XS, ZS)
U2_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_AA(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
U2_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → APPEND_IN_AAA(ZS, cons(X, nil), YS)
APPEND_IN_AAA(cons(X, XS), YS, cons(X, ZS)) → U1_AAA(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
APPEND_IN_AAA(cons(X, XS), YS, cons(X, ZS)) → APPEND_IN_AAA(XS, YS, ZS)
U4_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_AA(X, XS, YS, shuffle_in_aa(ZS, YS))
U4_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → SHUFFLE_IN_AA(ZS, YS)

The TRS R consists of the following rules:

query_in_g(XS) → U6_g(XS, shuffle_in_aa(cons(X, XS), YS))
shuffle_in_aa(nil, nil) → shuffle_out_aa(nil, nil)
shuffle_in_aa(cons(X, XS), cons(X, YS)) → U4_aa(X, XS, YS, reverse_in_aa(XS, ZS))
reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
U4_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_aa(X, XS, YS, shuffle_in_aa(ZS, YS))
U5_aa(X, XS, YS, shuffle_out_aa(ZS, YS)) → shuffle_out_aa(cons(X, XS), cons(X, YS))
U6_g(XS, shuffle_out_aa(cons(X, XS), YS)) → query_out_g(XS)

The argument filtering Pi contains the following mapping:
query_in_g(x1)  =  query_in_g(x1)
U6_g(x1, x2)  =  U6_g(x1, x2)
shuffle_in_aa(x1, x2)  =  shuffle_in_aa
shuffle_out_aa(x1, x2)  =  shuffle_out_aa
U4_aa(x1, x2, x3, x4)  =  U4_aa(x4)
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x4)
query_out_g(x1)  =  query_out_g(x1)
U5_AA(x1, x2, x3, x4)  =  U5_AA(x4)
U6_G(x1, x2)  =  U6_G(x1, x2)
U2_AA(x1, x2, x3, x4)  =  U2_AA(x4)
QUERY_IN_G(x1)  =  QUERY_IN_G(x1)
REVERSE_IN_AA(x1, x2)  =  REVERSE_IN_AA
U1_AAA(x1, x2, x3, x4, x5)  =  U1_AAA(x5)
APPEND_IN_AAA(x1, x2, x3)  =  APPEND_IN_AAA
SHUFFLE_IN_AA(x1, x2)  =  SHUFFLE_IN_AA
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)
U4_AA(x1, x2, x3, x4)  =  U4_AA(x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

QUERY_IN_G(XS) → U6_G(XS, shuffle_in_aa(cons(X, XS), YS))
QUERY_IN_G(XS) → SHUFFLE_IN_AA(cons(X, XS), YS)
SHUFFLE_IN_AA(cons(X, XS), cons(X, YS)) → U4_AA(X, XS, YS, reverse_in_aa(XS, ZS))
SHUFFLE_IN_AA(cons(X, XS), cons(X, YS)) → REVERSE_IN_AA(XS, ZS)
REVERSE_IN_AA(cons(X, XS), YS) → U2_AA(X, XS, YS, reverse_in_aa(XS, ZS))
REVERSE_IN_AA(cons(X, XS), YS) → REVERSE_IN_AA(XS, ZS)
U2_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_AA(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
U2_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → APPEND_IN_AAA(ZS, cons(X, nil), YS)
APPEND_IN_AAA(cons(X, XS), YS, cons(X, ZS)) → U1_AAA(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
APPEND_IN_AAA(cons(X, XS), YS, cons(X, ZS)) → APPEND_IN_AAA(XS, YS, ZS)
U4_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_AA(X, XS, YS, shuffle_in_aa(ZS, YS))
U4_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → SHUFFLE_IN_AA(ZS, YS)

The TRS R consists of the following rules:

query_in_g(XS) → U6_g(XS, shuffle_in_aa(cons(X, XS), YS))
shuffle_in_aa(nil, nil) → shuffle_out_aa(nil, nil)
shuffle_in_aa(cons(X, XS), cons(X, YS)) → U4_aa(X, XS, YS, reverse_in_aa(XS, ZS))
reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
U4_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_aa(X, XS, YS, shuffle_in_aa(ZS, YS))
U5_aa(X, XS, YS, shuffle_out_aa(ZS, YS)) → shuffle_out_aa(cons(X, XS), cons(X, YS))
U6_g(XS, shuffle_out_aa(cons(X, XS), YS)) → query_out_g(XS)

The argument filtering Pi contains the following mapping:
query_in_g(x1)  =  query_in_g(x1)
U6_g(x1, x2)  =  U6_g(x1, x2)
shuffle_in_aa(x1, x2)  =  shuffle_in_aa
shuffle_out_aa(x1, x2)  =  shuffle_out_aa
U4_aa(x1, x2, x3, x4)  =  U4_aa(x4)
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x4)
query_out_g(x1)  =  query_out_g(x1)
U5_AA(x1, x2, x3, x4)  =  U5_AA(x4)
U6_G(x1, x2)  =  U6_G(x1, x2)
U2_AA(x1, x2, x3, x4)  =  U2_AA(x4)
QUERY_IN_G(x1)  =  QUERY_IN_G(x1)
REVERSE_IN_AA(x1, x2)  =  REVERSE_IN_AA
U1_AAA(x1, x2, x3, x4, x5)  =  U1_AAA(x5)
APPEND_IN_AAA(x1, x2, x3)  =  APPEND_IN_AAA
SHUFFLE_IN_AA(x1, x2)  =  SHUFFLE_IN_AA
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)
U4_AA(x1, x2, x3, x4)  =  U4_AA(x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 8 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN_AAA(cons(X, XS), YS, cons(X, ZS)) → APPEND_IN_AAA(XS, YS, ZS)

The TRS R consists of the following rules:

query_in_g(XS) → U6_g(XS, shuffle_in_aa(cons(X, XS), YS))
shuffle_in_aa(nil, nil) → shuffle_out_aa(nil, nil)
shuffle_in_aa(cons(X, XS), cons(X, YS)) → U4_aa(X, XS, YS, reverse_in_aa(XS, ZS))
reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
U4_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_aa(X, XS, YS, shuffle_in_aa(ZS, YS))
U5_aa(X, XS, YS, shuffle_out_aa(ZS, YS)) → shuffle_out_aa(cons(X, XS), cons(X, YS))
U6_g(XS, shuffle_out_aa(cons(X, XS), YS)) → query_out_g(XS)

The argument filtering Pi contains the following mapping:
query_in_g(x1)  =  query_in_g(x1)
U6_g(x1, x2)  =  U6_g(x1, x2)
shuffle_in_aa(x1, x2)  =  shuffle_in_aa
shuffle_out_aa(x1, x2)  =  shuffle_out_aa
U4_aa(x1, x2, x3, x4)  =  U4_aa(x4)
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x4)
query_out_g(x1)  =  query_out_g(x1)
APPEND_IN_AAA(x1, x2, x3)  =  APPEND_IN_AAA

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN_AAA(cons(X, XS), YS, cons(X, ZS)) → APPEND_IN_AAA(XS, YS, ZS)

R is empty.
The argument filtering Pi contains the following mapping:
APPEND_IN_AAA(x1, x2, x3)  =  APPEND_IN_AAA

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

APPEND_IN_AAAAPPEND_IN_AAA

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

APPEND_IN_AAAAPPEND_IN_AAA

The TRS R consists of the following rules:none


s = APPEND_IN_AAA evaluates to t =APPEND_IN_AAA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from APPEND_IN_AAA to APPEND_IN_AAA.





↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

REVERSE_IN_AA(cons(X, XS), YS) → REVERSE_IN_AA(XS, ZS)

The TRS R consists of the following rules:

query_in_g(XS) → U6_g(XS, shuffle_in_aa(cons(X, XS), YS))
shuffle_in_aa(nil, nil) → shuffle_out_aa(nil, nil)
shuffle_in_aa(cons(X, XS), cons(X, YS)) → U4_aa(X, XS, YS, reverse_in_aa(XS, ZS))
reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
U4_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_aa(X, XS, YS, shuffle_in_aa(ZS, YS))
U5_aa(X, XS, YS, shuffle_out_aa(ZS, YS)) → shuffle_out_aa(cons(X, XS), cons(X, YS))
U6_g(XS, shuffle_out_aa(cons(X, XS), YS)) → query_out_g(XS)

The argument filtering Pi contains the following mapping:
query_in_g(x1)  =  query_in_g(x1)
U6_g(x1, x2)  =  U6_g(x1, x2)
shuffle_in_aa(x1, x2)  =  shuffle_in_aa
shuffle_out_aa(x1, x2)  =  shuffle_out_aa
U4_aa(x1, x2, x3, x4)  =  U4_aa(x4)
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x4)
query_out_g(x1)  =  query_out_g(x1)
REVERSE_IN_AA(x1, x2)  =  REVERSE_IN_AA

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

REVERSE_IN_AA(cons(X, XS), YS) → REVERSE_IN_AA(XS, ZS)

R is empty.
The argument filtering Pi contains the following mapping:
REVERSE_IN_AA(x1, x2)  =  REVERSE_IN_AA

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

REVERSE_IN_AAREVERSE_IN_AA

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

REVERSE_IN_AAREVERSE_IN_AA

The TRS R consists of the following rules:none


s = REVERSE_IN_AA evaluates to t =REVERSE_IN_AA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from REVERSE_IN_AA to REVERSE_IN_AA.





↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

U4_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → SHUFFLE_IN_AA(ZS, YS)
SHUFFLE_IN_AA(cons(X, XS), cons(X, YS)) → U4_AA(X, XS, YS, reverse_in_aa(XS, ZS))

The TRS R consists of the following rules:

query_in_g(XS) → U6_g(XS, shuffle_in_aa(cons(X, XS), YS))
shuffle_in_aa(nil, nil) → shuffle_out_aa(nil, nil)
shuffle_in_aa(cons(X, XS), cons(X, YS)) → U4_aa(X, XS, YS, reverse_in_aa(XS, ZS))
reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
U4_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U5_aa(X, XS, YS, shuffle_in_aa(ZS, YS))
U5_aa(X, XS, YS, shuffle_out_aa(ZS, YS)) → shuffle_out_aa(cons(X, XS), cons(X, YS))
U6_g(XS, shuffle_out_aa(cons(X, XS), YS)) → query_out_g(XS)

The argument filtering Pi contains the following mapping:
query_in_g(x1)  =  query_in_g(x1)
U6_g(x1, x2)  =  U6_g(x1, x2)
shuffle_in_aa(x1, x2)  =  shuffle_in_aa
shuffle_out_aa(x1, x2)  =  shuffle_out_aa
U4_aa(x1, x2, x3, x4)  =  U4_aa(x4)
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x4)
query_out_g(x1)  =  query_out_g(x1)
SHUFFLE_IN_AA(x1, x2)  =  SHUFFLE_IN_AA
U4_AA(x1, x2, x3, x4)  =  U4_AA(x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

U4_AA(X, XS, YS, reverse_out_aa(XS, ZS)) → SHUFFLE_IN_AA(ZS, YS)
SHUFFLE_IN_AA(cons(X, XS), cons(X, YS)) → U4_AA(X, XS, YS, reverse_in_aa(XS, ZS))

The TRS R consists of the following rules:

reverse_in_aa(nil, nil) → reverse_out_aa(nil, nil)
reverse_in_aa(cons(X, nil), cons(X, nil)) → reverse_out_aa(cons(X, nil), cons(X, nil))
reverse_in_aa(cons(X, XS), YS) → U2_aa(X, XS, YS, reverse_in_aa(XS, ZS))
U2_aa(X, XS, YS, reverse_out_aa(XS, ZS)) → U3_aa(X, XS, YS, append_in_aaa(ZS, cons(X, nil), YS))
U3_aa(X, XS, YS, append_out_aaa(ZS, cons(X, nil), YS)) → reverse_out_aa(cons(X, XS), YS)
append_in_aaa(nil, XS, XS) → append_out_aaa(nil, XS, XS)
append_in_aaa(cons(X, XS), YS, cons(X, ZS)) → U1_aaa(X, XS, YS, ZS, append_in_aaa(XS, YS, ZS))
U1_aaa(X, XS, YS, ZS, append_out_aaa(XS, YS, ZS)) → append_out_aaa(cons(X, XS), YS, cons(X, ZS))

The argument filtering Pi contains the following mapping:
reverse_in_aa(x1, x2)  =  reverse_in_aa
reverse_out_aa(x1, x2)  =  reverse_out_aa
U2_aa(x1, x2, x3, x4)  =  U2_aa(x4)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
append_in_aaa(x1, x2, x3)  =  append_in_aaa
append_out_aaa(x1, x2, x3)  =  append_out_aaa
U1_aaa(x1, x2, x3, x4, x5)  =  U1_aaa(x5)
SHUFFLE_IN_AA(x1, x2)  =  SHUFFLE_IN_AA
U4_AA(x1, x2, x3, x4)  =  U4_AA(x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

U4_AA(reverse_out_aa) → SHUFFLE_IN_AA
SHUFFLE_IN_AAU4_AA(reverse_in_aa)

The TRS R consists of the following rules:

reverse_in_aareverse_out_aa
reverse_in_aaU2_aa(reverse_in_aa)
U2_aa(reverse_out_aa) → U3_aa(append_in_aaa)
U3_aa(append_out_aaa) → reverse_out_aa
append_in_aaaappend_out_aaa
append_in_aaaU1_aaa(append_in_aaa)
U1_aaa(append_out_aaa) → append_out_aaa

The set Q consists of the following terms:

reverse_in_aa
U2_aa(x0)
U3_aa(x0)
append_in_aaa
U1_aaa(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule SHUFFLE_IN_AAU4_AA(reverse_in_aa) at position [0] we obtained the following new rules:

SHUFFLE_IN_AAU4_AA(U2_aa(reverse_in_aa))
SHUFFLE_IN_AAU4_AA(reverse_out_aa)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ NonTerminationProof

Q DP problem:
The TRS P consists of the following rules:

U4_AA(reverse_out_aa) → SHUFFLE_IN_AA
SHUFFLE_IN_AAU4_AA(reverse_out_aa)
SHUFFLE_IN_AAU4_AA(U2_aa(reverse_in_aa))

The TRS R consists of the following rules:

reverse_in_aareverse_out_aa
reverse_in_aaU2_aa(reverse_in_aa)
U2_aa(reverse_out_aa) → U3_aa(append_in_aaa)
U3_aa(append_out_aaa) → reverse_out_aa
append_in_aaaappend_out_aaa
append_in_aaaU1_aaa(append_in_aaa)
U1_aaa(append_out_aaa) → append_out_aaa

The set Q consists of the following terms:

reverse_in_aa
U2_aa(x0)
U3_aa(x0)
append_in_aaa
U1_aaa(x0)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

U4_AA(reverse_out_aa) → SHUFFLE_IN_AA
SHUFFLE_IN_AAU4_AA(reverse_out_aa)
SHUFFLE_IN_AAU4_AA(U2_aa(reverse_in_aa))

The TRS R consists of the following rules:

reverse_in_aareverse_out_aa
reverse_in_aaU2_aa(reverse_in_aa)
U2_aa(reverse_out_aa) → U3_aa(append_in_aaa)
U3_aa(append_out_aaa) → reverse_out_aa
append_in_aaaappend_out_aaa
append_in_aaaU1_aaa(append_in_aaa)
U1_aaa(append_out_aaa) → append_out_aaa


s = SHUFFLE_IN_AA evaluates to t =SHUFFLE_IN_AA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

SHUFFLE_IN_AAU4_AA(reverse_out_aa)
with rule SHUFFLE_IN_AAU4_AA(reverse_out_aa) at position [] and matcher [ ]

U4_AA(reverse_out_aa)SHUFFLE_IN_AA
with rule U4_AA(reverse_out_aa) → SHUFFLE_IN_AA

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.